#!/bin/sh

set -e

groupadd gpio --system || true
groupadd pwm --system || true
groupadd eqep --system || true
groupadd remoteproc --system || true
groupadd rpmsg_pru --system || true

case "$1" in
	configure)
		net_rcnee=$(cat /etc/apt/sources.list | grep repos.rcn-ee.net || true)
		if [ ! "x${net_rcnee}" = "x" ] ; then
			sed -i -e 's:repos.rcn-ee.net:repos.rcn-ee.com:g' /etc/apt/sources.list
		fi

		if [ -x /usr/sbin/update-initramfs -a -e /etc/initramfs-tools/initramfs.conf ] ; then
			update-initramfs -u
		fi
	;;

	abort-upgrade|abort-remove|abort-deconfigure)
	;;

	*)
		echo "postinst called with unknown argument \`$1'" 1>&2
		exit 1
	;;
esac

#DEBHELPER#
